package com.xucy.springboot.designmodel.creational.prototype.deep;

import java.util.Date;

/**
 * @Author xucy
 * @Date 2019-07-17 17:48
 * @Description
 **/

public class Test {

    public static void main(String[] args) throws CloneNotSupportedException {
        Date date=new Date(0L);
        DeepProtoType deepProtoType=new DeepProtoType();
        deepProtoType.setDate(date);
        deepProtoType.setMsg("深克隆");


        DeepProtoType deepProtoType1= (DeepProtoType) deepProtoType.clone();
        System.out.println(deepProtoType);
        System.out.println(deepProtoType1);


        deepProtoType.getDate().setTime(40023L);
        System.out.println(deepProtoType);
        System.out.println(deepProtoType1);
    }
}
